//
//  ZH_PayTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/27.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_PayTableViewCell.h"
@interface ZH_PayTableViewCell()
@property (nonatomic,weak)UIImageView *images;
@property (nonatomic,weak)UILabel *nameLabel;
@property (nonatomic,weak)UILabel *rightLabel;
@end
@implementation ZH_PayTableViewCell

+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_PayTableViewCell";
    ZH_PayTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_PayTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
- (void)initDefault{
    [self unShowClickEffect];
    //    self.topShortLineImage.hidden = NO;
    self.bottomShortLineImage.hidden = NO;
}
- (void)loadSubviewConstraints{
    [self.images mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(9));
        make.width.mas_equalTo(FITSCALE(34));
        make.height.mas_equalTo(FITSCALE(34));
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(FITSCALE(21));
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.images.mas_right).offset(FITSCALE(10));
    }];
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView).offset(FITSCALE(-21));
    }];
}
- (void)setImageString:(NSString *)imageString{
    self.images.image = [UIImage imageNamed:imageString];
}
- (void)setNameString:(NSString *)nameString{
    self.nameLabel.text = nameString;
}
- (void)isRightHidden:(BOOL)isbool{
    self.rightLabel.hidden = isbool;
}
#pragma mark - getter,setter
- (UIImageView *)images{
    if (!_images) {
        UIImageView *image = [UIImageView createImageViewWithName:@""];
        [self.contentView addSubview:_images = image];
    }
    return _images;
}
- (UILabel *)nameLabel{
    if (!_nameLabel) {
        UILabel *label = [UILabel createLabelWithText:@"" font:kFontSize_30];
        [self.contentView addSubview:_nameLabel = label];
    }
    return _nameLabel;
}
- (UILabel *)rightLabel{
    if (!_rightLabel) {
        UILabel *label = [UILabel createLabelWithText:@"余额不足" font:kFontSize_28];
        label.textColor = [UIColor colorWithHexString:@"#999999"];
        label.hidden = YES;
        [self.contentView addSubview:_rightLabel = label];
    }
    return _rightLabel;
}
@end
